1 /* 2 * Copyright (c) 2011-2014 - Mauro Carvalho Chehab 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation version 2.1 of the License. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU Lesser General Public License for more details. 12 * 13 * You should have received a copy of the GNU Lesser General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 16 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 17 */ 18 19 module libdvbv5_d.dvb_sat; 20 21 import libdvbv5_d.dvb_fe: dvb_v5_fe_parms; 22 23 extern (C): 24 25 /** 26 * @file dvb-sat.h 27 * @ingroup satellite 28 * @brief Provides interfaces to deal with DVB Satellite systems. 29 * @copyright GNU Lesser General Public License version 2.1 (LGPLv2.1) 30 * @author Mauro Carvalho Chehab 31 * 32 * @par Bug Report 33 * Please submit bug reports and patches to linux-media@vger.kernel.org 34 */ 35 36 /* 37 * Satellite handling functions 38 */ 39 40 /** 41 * @struct dvb_sat_lnb 42 * @brief Stores the information of a LNBf 43 * @ingroup satellite 44 * 45 * @param name long name of the LNBf type 46 * @param alias short name for the LNBf type 47 * 48 * The LNBf (low-noise block downconverter) is a type of amplifier that is 49 * installed inside the parabolic dishes. It converts the antenna signal to 50 * an Intermediate Frequency. Several Ku-band LNBf have more than one IF. 51 * The lower IF is stored at lowfreq, the higher IF at highfreq. 52 * The exact setup for those structs actually depend on the model of the LNBf, 53 * and its usage. 54 */ 55 struct dvb_sat_lnb 56 { 57 const(char)* name; 58 const(char)* alias_; 59 60 /* 61 * Legacy fields, kept just to avoid ABI breakages 62 * Should not be used by new applications 63 */ 64 uint lowfreq; 65 uint highfreq; 66 uint rangeswitch; 67 68 struct dvbsat_freqrange 69 { 70 uint low; 71 uint high; 72 } 73 74 dvbsat_freqrange[2] freqrange; 75 } 76 77 // struct dvb_v5_fe_parms; 78 79 /* From libsat.c */ 80 81 /** 82 * @brief search for a LNBf entry 83 * @ingroup satellite 84 * 85 * @param name name of the LNBf entry to seek. 86 * 87 * On sucess, it returns a non-negative number with corresponds to the LNBf 88 * entry inside the LNBf structure at dvb-sat.c. 89 * 90 * @return A -1 return code indicates that the LNBf was not found. 91 */ 92 int dvb_sat_search_lnb (const(char)* name); 93 94 /** 95 * @brief prints the contents of a LNBf entry at STDOUT. 96 * @ingroup satellite 97 * 98 * @param index index for the entry 99 * 100 * @return returns -1 if the index is out of range, zero otherwise. 101 */ 102 int dvb_print_lnb (int index); 103 104 /** 105 * @brief Prints all LNBf entries at STDOUT. 106 * @ingroup satellite 107 * 108 * This function doesn't return anything. Internally, it calls dvb_print_lnb() 109 * for all entries inside its LNBf database. 110 */ 111 void dvb_print_all_lnb (); 112 113 /** 114 * @brief gets a LNBf entry at its internal database 115 * @ingroup satellite 116 * 117 * @param index index for the entry. 118 * 119 * @return returns NULL if not found, of a struct dvb_sat_lnb pointer otherwise. 120 * 121 * NOTE: none of the strings are i18n translated. In order to get the 122 * translated name, you should use dvb_sat_get_lnb_name() 123 */ 124 const(dvb_sat_lnb)* dvb_sat_get_lnb (int index); 125 126 /** 127 * @brief gets a LNBf entry at its internal database 128 * @ingroup satellite 129 * 130 * @param index index for the entry. 131 * 132 * @return returns NULL if not found, of the name of a LNBf, 133 * translated to the user language, if translation is available. 134 */ 135 const(char)* dvb_sat_get_lnb_name (int index); 136 137 /** 138 * @brief sets the satellite parameters 139 * @ingroup satellite 140 * 141 * @param parms struct dvb_v5_fe_parms pointer. 142 * 143 * This function is called internally by the library to set the LNBf 144 * parameters, if the dvb_v5_fe_parms::lnb field is filled. 145 * 146 * @return 0 on success. 147 */ 148 int dvb_sat_set_parms (dvb_v5_fe_parms* parms); 149 150 /** 151 * @brief return the real satellite frequency 152 * @ingroup satellite 153 * 154 * @param parms struct dvb_v5_fe_parms pointer. 155 * 156 * This function is called internally by the library to get the satellite 157 * frequency, considering the LO frequency. 158 * 159 * @return frequency. 160 */ 161 int dvb_sat_real_freq (dvb_v5_fe_parms* p, int freq); 162 163 // _LIBSAT_H